package org.clevernote.foundations;

public class Preferences {

	static java.util.prefs.Preferences prefs_ = java.util.prefs.Preferences
			.userNodeForPackage(Preferences.class);

	/**
	 * Store user preferences
	 * 
	 * @param key
	 * @param value
	 */
	public static void store(final String key, final String value) {
		prefs_.put(key, value);
	}

	/**
	 * Retrieve user preferences
	 * 
	 * @param key
	 * @return
	 */
	public static String retreive(final String key) {
		return retreive(key, null);
	}

	/**
	 * Retrieve user preferences with default
	 * 
	 * @param key
	 * @param def
	 * @return
	 */
	public static String retreive(final String key, String def) {
		return prefs_.get(key, def);
	}

}
